onmessage = function(event){

var url         = event.data[0];
var params      = event.data[1];
var wid         = event.data[2];
var response    = getResponse(url,params);
var return_vars = new Array(wid,response);

postMessage(return_vars);

}

function getResponse(url,params) {

var http = new XMLHttpRequest();

if (http) {

function transferComplete() { return 'Ajax call successful'; }
function transferFailed()   { return 'Ajax call failed';     }
function transferCanceled() { return 'Ajax call cancelled';  }

http.open("POST", url, false);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.send(params);
if ( http.readyState == 4 && http.status == 200 ) return http.responseText;

} else return false;

}